from devtools import debug
from pydantic import BaseModel, Field, ValidationError

from my_typing import *


class Model(BaseModel):
    x: ListInt = Field(max_length=3)


try:
    Model(x=[1, 2, 3, 4])
except ValidationError as exc:
    debug(exc.errors())
    # print(repr(exc.errors()[0]['type']))
    #> 'too_long'